package com.emotion.recognition.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.Widget;

public class UploadPanel extends Composite {

	private static UploadPanelUiBinder uiBinder = GWT
			.create(UploadPanelUiBinder.class);

	interface UploadPanelUiBinder extends UiBinder<Widget, UploadPanel> {
	}

	private static final String UPLOAD_ACTION_URL = GWT.getModuleBaseURL()
			+ "FileUploadService";

	@UiField
	FormPanel formPanel;

	public UploadPanel() {
		initWidget(uiBinder.createAndBindUi(this));

		// Submit settings.
		formPanel.setAction(UPLOAD_ACTION_URL);
		formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
		formPanel.setMethod(FormPanel.METHOD_POST);
	}
}
